<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>智能设备</title>
		<link rel="stylesheet" href="../src/css/layui.css">
		<link rel="stylesheet" type="text/css" href="../dist/css/common.css" />
	</head>

	<body>
		<div class="layui-fluid">
			<div class="w-title"><span class="w-blueline"></span>
				<a href="###">智能设备</a>
			</div>
			<div class="layui-row">
				<div class="layui-col-md1">&nbsp;</div>
				<div class="layui-col-md4">
					<div class="layui-form-item">
						<label class="layui-form-label">所属基地</label>
						<div class="layui-input-block">
							<select name="city" lay-verify="">
								<option value="">请选择</option>
							</select>
						</div>
					</div>
				</div>
				<div class="layui-col-md1">&nbsp;</div>
				<div class="layui-col-md4">
					<div class="layui-form-item">
						<label class="layui-form-label">所属分区</label>
						<div class="layui-input-block">
							<select name="city" lay-verify="">
								<option value="">请选择</option>
							</select>
						</div>
					</div>
				</div>
				
			</div>
			<div class="layui-row">
				<div class="layui-col-md1">&nbsp;</div>
				<div class="layui-col-md4">
					<div class="layui-form-item">
						<label class="layui-form-label">设备名称</label>
						<div class="layui-input-block">
							<input type="text" name="" id="" value="" />
						</div>
					</div>
				</div>
				<div class="layui-col-md1">&nbsp;</div>
				<div class="layui-col-md4">
					<div class="layui-form-item">
						<label class="layui-form-label">设备类型</label>
						<div class="layui-input-block">
							<select name="city" lay-verify="">
								<option value="">请选择</option>
							</select>
						</div>
					</div>
				</div>
			</div>
			<div class="layui-row">
				<div class="layui-col-md1">&nbsp;</div>
				<div class="layui-col-md4">
					<div class="layui-form-item">
						<label class="layui-form-label">设备状态</label>
						<div class="layui-input-block">
							<select name="city" lay-verify="">
								<option value="">请选择</option>
							</select>
						</div>
					</div>
				</div>
				<div class="layui-col-md2">&nbsp;</div>
				<div class="layui-col-md4">
					<a href="###" class="layui-btn">查询</a>
					<a href="###" class="layui-btn">重置</a>
					<a target="iframe" href="sbtj.html" class="layui-btn">添加</a>
				</div>
			</div>
			<table id="demoTable" lay-filter="test"></table>
		</div>
		<script src="../src/layui.js"></script>
		<script type="text/html" id="barDemo">
			<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">修改</a>
			<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
			<a class="layui-btn layui-btn-xs" lay-event="edit">规格文件</a>
		</script>
		<script>
			layui.use(['table', 'jquery'], function() {
				var table = layui.table;
				var $ = jQuery = layui.$;
				//第一个实例
				table.render({
					elem: '#demoTable',
					//					height: 315
					//  ,url: '/demo/table/user/' //数据接口
					//						,
					page: true //开启分页
						,
					cols: [
						[ //表头
							{
								field: 'xh',
								title: '序号',
								width: '10%',
								sort: true,
								align: 'center',
								fixed: 'left'
							}, {
								field: 'sbid',
								title: '设备id',
								align: 'center',
								width: '10%'
							}, {
								field: 'sqkey',
								title: '授权key',
								align: 'center',
								width: '10%',
								sort: true
							}, {
								field: 'ssdkmc',
								title: '所属地块名称',
								align: 'center',
								width: '30%'
							}, {
								field: 'sblx',
								title: '设备类型',
								align: 'center',
								width: '10%'
							}, {
								field: 'sbzt',
								title: '设备状态',
								width: '10%',
								align: 'center',
							}, {
								field: 'cz',
								title: '操作',
								width: '20%',
								align: 'center',
								toolbar: '#barDemo'
							}
						]
					],
					data: [{
						"xh": "1",
						"sbid": "大棚卷帘控制柜",
						"sqkey": "00000",
						"ssdkmc": "黑龙江",
						"sblx": "开关设备",
						"sbzt": "关闭",
						"cjsj": "2018-01-01 9：00",
					}, {
						"xh": "2",
						"sbid": "大棚卷帘控制柜",
						"sqkey": "00000",
						"ssdkmc": "黑龙江",
						"sblx": "开关设备",
						"sbzt": "关闭",
						"cjsj": "",
					}]
				});
				$('.demoTable .layui-btn').on('click', function() {
					var type = $(this).data('type');
					active[type] ? active[type].call(this) : '';
				});
			});
		</script>
	</body>

</html>